<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
#macro ( genericTree $somelist ) 
#foreach ( $some in $somelist )
<option value="$!some.id">#if($!some.level>0)
#foreach($count in [0..$!some.level])&nbsp;#end #end $!some.className</option>
#genericTree($some.childs) 
#end 
#end
</head>
<link href="$!webPath/resources/style/system/manage/$!{config.websiteCss}/template.css"  rel="stylesheet" type="text/css"/>
<script src="$!webPath/resources/js/jquery-1.8.3.min.js"></script>
<script src="$!webPath/resources/js/jquery.validate.min.js"></script>
<script src="$!webPath/resources/js/jquery.shop.common.js"></script>
<script src="$!webPath/resources/js/jquery.poshytip.min.js"></script>
<script charset="utf-8" src="$!webPath/resources/editor/kindeditor.js"></script>
<script charset="utf-8" src="$!webPath/resources/editor/lang/zh_CN.js"></script>
<script>
//options为编辑配置属性
var options = {
        cssPath : '$!webPath/resources/editor/themes/default/default.css',
        filterMode : true,
		uploadJson:'$!webPath/upload.htm',
		width : '700px',
		height:'400px',
		syncType:"form",
		afterCreate : function() {
							var self = this;
							self.sync();
						},
		afterChange : function() {
							var self = this;
							self.sync();
						},
		afterBlur : function() {
							var self = this;
							self.sync();
						},
		items:['source', '|', 'fullscreen', 'undo', 'redo', 'print', 'cut', 'copy', 'paste',
			'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
			'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
			'superscript', '|', 'selectall', 'clearhtml','quickformat','|',
			'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
			'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'table', 'hr', 'emoticons', 'link', 'unlink', '|', 'about']
};
jQuery(document).ready(function(){
//设置默认状态以及判断初始显示状态
  jQuery("#theForm").validate({
    rules:{
	  title:{
	    required :true
	  },
	  content:{required:true}
	 },
	messages:{
	  title:{required:"文章标题不能为空"},
	  content:{required:"文章内容不能为空"}
	}
  });
  //
  editor = KindEditor.create('#content',options); 
  //
});

function saveForm(method){
   editor.sync();
   jQuery("#theForm").submit();
}
</script>
<body>
<div class="cont">
  <h1 class="seth1">系统文章</h1>
  <div class="settab"><span class="tab-one"></span> <span class="tabs"> <a href="$!webPath/admin/document_list.htm">管理</a> | <a href="$!webPath/admin/document_add.htm" #if(!$!edit)class="this"#end>新增</a> #if($!edit) <a href="javascript:void(0);" class="this">编辑</a> #end </span> <span class="tab-two"></span></div>
  <form name="theForm" id="theForm" action="$!webPath/admin/document_save.htm" method=post>
    <input name="id" type="hidden" id="id" value="$!obj.id" />
    <input name="currentPage" type="hidden" id="currentPage" value="$!currentPage" />
    <input name="list_url" type="hidden" id="list_url" value="$!webPath/admin/document_list.htm" />
    <input name="add_url" type="hidden" id="add_url" value="$!webPath/admin/document_add.htm" />
    <div class="setcont">
      <ul class="set1">
        <li><strong class="orange fontsize20">*</strong>文章标题</li>
        <li><span class="webname">
          <input name="title" type="text" id="title" value="$!obj.title" size="40" />
          </span></li>
      </ul>
      <ul class="set1">
        <li><strong class="orange fontsize20">*</strong>内容</li>
        <li><span class="webname">
          <textarea name="content" cols="40" id="content">$!obj.content</textarea>
          </span></li>
      </ul>
    </div>
  </form>
  <div class="submit">
    <input name="save" type="button" value="提交" onclick="saveForm()" />
  </div>
</div>
</body>
</html>
